package listbyorder.access401_500.test454;

public class Solution2 {

    // 最暴力的解法，超时
    public int fourSumCount(int[] A, int[] B, int[] C, int[] D) {
        int len = A.length;
        int count = 0;
        for (int i = 0; i < len; i++) {
            int a = A[i];
            for (int j = 0; j < len; j++) {
                int b = B[j];
                for (int k = 0; k < len; k++) {
                    int c = C[k];
                    for (int l = 0; l < len; l++) {
                        if (a + b + c + D[l] == 0) {
                            count++;
                        }
                    }
                }
            }
        }
        return count;
    }
}
